﻿using System;
using TI_BLE_HCI_ClientLib.BaseEntities;

namespace TI_BLE_HCI_ClientLib.HCIBaseEntities
{
    public class HCIEvent : BaseProtocolEntity
    {
        private byte _eventCode;

        private BaseEntityParameter[] _parameters = new BaseEntityParameter[0];

        public HCIEvent()
        {
            base.PACKET_TYPE = 0x04;
        }

        public byte EventCode
        {
            get { return _eventCode; }
            set { _eventCode = value; }
        }

        public BaseEntityParameter[] Parameters
        {
            get { return _parameters; }
            set { _parameters = value; }
        }

        protected void addParameters(BaseEntityParameter[] parsToAdd)
        {
            var newPars = new BaseEntityParameter[_parameters.Length + parsToAdd.Length];

            Array.Copy(_parameters, newPars, _parameters.Length);
            Array.Copy(parsToAdd, 0, newPars, newPars.Length, parsToAdd.Length);

            _parameters = newPars;
        }

        public override byte[] ToByteArray()
        {
            return null;
        }
    }
}